home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-jena.de!news
- From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
- Newsgroups: comp.lang.c++
- Subject: SPARCompiler error
- Date: 31 Jan 1996 15:21:34 GMT
- Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
- Message-ID: <4eo1du$qlr@fsuj01.rz.uni-jena.de>
- Reply-To: mkt@isun04.inf.uni-jena.de
- NNTP-Posting-Host: isun07.inf.uni-jena.de
-
- The SPARCompiler 4.0x has a nice incompatibility between
- C++ and ANSI-C 'optimized away'. The C++ compiler behaves
- like an ANSI-C compiler here:
-
- cout << (1 ? 'a' : 'b') << endl;
-
- Question: What is the output on the screen?
- In C++ it is an 'a'.
- Not so the SPARCompiler. It prints out a '97'!!!
- This is exactly what ANSI-C compiler do! They do an integral promotion
- on the second and third operand of ?:
- C++ does no promotion.
- Who can tell these SPARCompiler-Guys about the error?
-
-
-